<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="../public/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../public/lib/jquery/1.9.1/jquery.min.js"></script>
<#include "lib/lib.html" />
<title>项目新增</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/project/updateProject.do" method="post"  class="form form-horizontal" id="form-area-add" enctype="multipart/form-data">
		<div class="row cl">
			<input type="hidden" value="${project.id}" name="id">
			<label class="form-label col-3"><span class="c-red">*</span>服务分类：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="classicId" name="classicId" nullmsg="请选择">
					<#if list?? && list?size gt 0>
						<#list list as dl >
							<option value="${dl.id}" <#if project.classicId == dl.id>selected="selected"</#if>>${dl.classicName}</option>
						</#list>
					</#if>
				</select>
			</span> 
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>项目名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${project.projectName!}" placeholder="" id="projectName" name="projectName" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">项目图片：</label>
			<div class="formControls col-5">
				  <span class="btn-upload">
				  <a href="javascript:void();" class="btn btn-primary radius"><i class="iconfont">&#xf0020;</i> 浏览文件</a>
				 <input type="file" multiple name="file" class="input-file" accept="image/png,image/jpg,image/jpeg,imge/bmp,image/gif">
				 </span>
				 <img alt="" src="${project.projectImages!}" width="160" height="160">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">项目时长：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${project.projectTimes!}" placeholder="" id="projectTimes" name="projectTimes">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">服务开始时间：</label>
			<div class="formControls col-5">
				<input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="serviceStart" value="${project.serviceStart?string('yyyy-MM-dd')!}" name="serviceStart" class="input-text Wdate" style="width:180px;">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">服务结束时间：</label>
			<div class="formControls col-5">
				<input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="serviceEnd" value="${project.serviceEnd?string('yyyy-MM-dd')!}" name="serviceEnd" class="input-text Wdate" style="width:180px;">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>项目原价：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${project.projectOriginalPrice / 100!}" placeholder="" id="projectOriginalPrice" name="projectOriginalPrice">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>项目折后价：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${project.projectPrice / 100!}" placeholder="" id="projectPrice" name="projectPrice">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">项目描述：</label>
			<div class="formControls col-5">
				<textarea rows="8" cols="45" id="projectDesc" name="projectDesc">${project.projectDesc!}</textarea>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
<!-- 				<input class="btn btn-primary radius" type="button" onclick="test()"  value="&nbsp;&nbsp;提交&nbsp;&nbsp;"> -->
				<button type="button" onclick="submitBtn()" class="btn btn-success radius" id="admin-role-save" name="admin-role-save">
						<i class="icon-ok"></i> 确定
				</button>
				<button type="button" onclick="layer_close()" class="btn btn-success radius" id="admin-role-close"
						name="admin-role-close">
						<i class="icon-ok"></i>取消
					</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
function submitBtn(){
	var classicId = $("#classicId").val();
	if(classicId == ""){
		layer.msg('请选择服务分类', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var projectName = $("#projectName").val();
	if(projectName == null || projectName == ""){
		layer.msg('项目名称不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var projectPrice = $("#projectPrice").val();
	if(projectPrice == null || projectPrice == ""){
		layer.msg('项目价格不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var projectOriginalPrice = $("#projectOriginalPrice").val();
	if(projectOriginalPrice == null || projectOriginalPrice == ""){
		layer.msg('项目原价不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	$("#form-area-add").ajaxForm({
		success:function(data) {
			if(data == 200){
				layer.msg('添加成功!', {icon: 6,time:1000});
				window.parent.location.href="${basePath}/project/list.do";
			}else{
				layer.msg(data.data, {icon: 5,time:1000});
			}
		},      
		dataType:"json"   
	}).submit(); 	
}
</script>
</body>
</html>